package com.yhj.vo;

/**
 * @author yaohj
 * @date 2024年11月21日 15:45
 */
public class CommonResult<T>{
    private Integer code;

    private String msg;

    private T data;

    public CommonResult(Integer code, T data){
        this.data= data;
        this.code= code;
    }

    public static  <T> CommonResult<T>  success(T data){
        return new CommonResult<>(200, data);
    }

    public static  <T> CommonResult<T>  error( Integer code, T data){
        return new CommonResult<>(code, data);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
